package com.chzn;

import com.chzn.component.PersonService;
import com.chzn.config.AppConfig;
import com.chzn.config.AppConfigTwo;
import com.chzn.factoryBean.MySmartFactoryBean;
import org.springframework.context.annotation.AnnotationConfigApplicationContext;

/**
 * @Description
 * @Author houchenkai
 * @Created Date: 2020/11/9 16:19
 * @ClassName
 */
public class UserServiceTest {

	public static void main(String[] args) {

		AnnotationConfigApplicationContext ac = new AnnotationConfigApplicationContext(AppConfig.class,AppConfigTwo.class);
		Object mySmartFactoryBean =  ac.getBean("mySmartFactoryBean");
		Object bean1 = ac.getBean("&mySmartFactoryBean");
		System.out.println("===============main方法输出====================");
		System.out.println(bean1);
//		userService.test();

		/*ac.registerBean(UserService.class, new Supplier<UserService>() {
			@Override
			public UserService get() {
				return new UserService();
			}
		});
		System.out.println(ac.getBean(UserService.class));*/

	}
}
